import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter)

let routes=[
    {
        path:"/home",
        component:()=>import("@/components/home/home"),
        meta:{
            show:true
        }
    },
    {
        path:"/",
        redirect:"/home"
    },
    {
        path:"/auth/login",
        component:()=>import("@/components/auth/login"),
        meta:{
            show:true
        }
    },
    {
        path:"/auth/register",
        component:()=>import("@/components/auth/register"),
        meta:{
            show:true
        }
    },
    {
        path:"/blog",
        component:()=>import("@/components/blog/blog"),
        redirect:"/article"
    },
    {
        path:"/article",
        component:()=>import("@/components/blog/article/article"),
        children:[
            {
                path:"arContent",
                component:()=>import("@/components/blog/article/article-content/arContent"),
            },
            {
                path:":id",
                component:()=>import("@/components/blog/article/detail-article/detailArticle"),
            },
            {
                path:"/article",
                redirect:"/article/arContent"
            } 
        ]
    }, 
    {
        path:"/about",
        component:()=>import("@/components/blog/about/about")
    },
    {
        path:"/diary",
        component:()=>import("@/components/blog/diary/diary")
    },
    {
        path:"/message",
        component:()=>import("@/components/blog/message/message")
    }
]

let router=new VueRouter({
    mode:"history",
    base:process.env.BASE_URL,
    routes
})

export default router